package com.szly.phm.admin.controller;

import com.szly.phm.admin.aspectj.annotation.OperationLogAnnotation;
import com.szly.phm.admin.aspectj.enums.ModuleEnum;
import com.szly.phm.admin.aspectj.enums.OperationActionEnum;
import com.szly.phm.admin.utils.CustomResponse;
import com.szly.phm.admin.utils.SecurityUtils;
import com.szly.phm.common.entity.dto.FaFault.*;
import com.szly.phm.common.entity.dto.ensure.*;
import com.szly.phm.common.entity.dto.faRepair.*;
import com.szly.phm.common.entity.dto.user.LoginUserDTO;
import com.szly.phm.common.entity.result.PageResult;
import com.szly.phm.common.entity.result.RootResponse;
import com.szly.phm.common.entity.vo.Fault.FaPhenomenonVO;
import com.szly.phm.common.entity.vo.Fault.FaPhenomenonRecordVO;
import com.szly.phm.common.entity.vo.Fault.FaultRecordPhenomenonVO;
import com.szly.phm.common.entity.vo.ensure.*;
import com.szly.phm.common.entity.vo.faRepair.*;
import com.szly.phm.common.service.IEnsureService;
import com.szly.phm.common.service.IRepairService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * phm
 *
 * @author: git.jas0nch
 * date: 2021-10-18
 */
@RestController
@Validated
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping("/pc/ensureRepair")
@Api(tags = "保障维修模块管理")
public class FaController {

    private final IEnsureService iEnsureService;

    private final IRepairService iRepairService;


    @ApiOperation(value = "查询结构件对应的保障和保障类型")
    @GetMapping("/v1/ensureEnsureType2Structure")
    @CustomResponse
    public RootResponse<EnsureEnsureType2StructureVO> queryEnsureEnsureType2Structure(@Valid EnsureEnsureType2StructurePageDTO ensureType2StructurePageDTO){
        return iEnsureService.queryEnsureEnsureType2Structure(ensureType2StructurePageDTO);
    }// end the query method

//    @ApiOperation(value = "查询保障基础表对应的关重件，分系统等绑定的ensure")
//    @GetMapping("/v1/ensure2Structure")
//    public RootResponse<FaEnsure2StructureVO> queryEnsure2Structure(@Valid EnsureStructurePageDTO ensureStructurePageDTO){
//        return iEnsureService.queryEnsure2Structure(ensureStructurePageDTO);
//    }// end the query method

    // create
    @ApiOperation(value = "添加结构件对应的保障基础到保障计划")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION, getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/ensurePlan2Structure")
    @CustomResponse
    public RootResponse createStructure2EnsurePlan(@Valid @RequestBody CreateStructureEnsureDTO createStructureEnsureDTO) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createStructure2EnsurePlan(createStructureEnsureDTO, userDTO);
    }// end the create method

    /**
     * taskLevel
     * @param
     * @return
     */
    @ApiOperation(value = "分页查询任务级别类型")
    @GetMapping("/v1/taskLevel")
    @CustomResponse
    public RootResponse<PageResult<FaTaskLevelVO>> queryTaskLevelPageV1(@Valid FaTaskLevelPageDTO faTaskLevelPageDTO){
        return iEnsureService.queryFaTaskLevelPage(faTaskLevelPageDTO);
    }// end the query method

    // create
    @ApiOperation(value = "添加任务级别类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION, getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/taskLevel")
    @CustomResponse
    public RootResponse createTaskLevelV1(@Valid @RequestBody CreateFaTaskLevelDTO createFaTaskLevelDTO) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createFaTaskLevel(createFaTaskLevelDTO, userDTO);
    }// end the create method

    @ApiOperation(value = "添加任务级别类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION, getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/taskLevel")
    @CustomResponse
    public RootResponse updateTaskLevelV1(@Valid @RequestBody UpdateFaTaskLevelDTO updateFaTaskLevelDTO) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.updateFaTaskLevel(updateFaTaskLevelDTO, userDTO);
    }// end the create method

    @ApiOperation(value = "删除任务级别类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.OTHER, getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/taskLevel")
    @CustomResponse
    public RootResponse deleteParameterTypeV1(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteFaTaskLevel(id, userDTO);
    }// end the delete method

    /**
     * ensureType
     * @param
     * @return
     */
    @ApiOperation(value = "分页查询ensure类型")
    @GetMapping("/v1/ensureType")
    @CustomResponse
    public RootResponse<PageResult<List<FaEnsureTypeVO>>> queryEnsureTypePageV1(@Valid EnsureTypePageDTO faEnsureTypePageDTO){
        return iEnsureService.queryFaEnsureTypePage(faEnsureTypePageDTO);
    }// end the query method

    // create
    @ApiOperation(value = "添加ensure类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION, getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/ensureType")
    @CustomResponse
    public RootResponse createEnsureTypeV1(@Valid @RequestBody CreateEnsureTypeDTO createFaEnsureTypeDTO) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createFaEnsureType(createFaEnsureTypeDTO, userDTO);
    }// end the create method

    @ApiOperation(value = "添加ensure类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION, getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/ensureType")
    @CustomResponse
    public RootResponse updateEnsureTypeV1(@Valid @RequestBody UpdateEnsureTypeDTO updateFaEnsureTypeDTO) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.updateFaEnsureType(updateFaEnsureTypeDTO, userDTO);
    }// end the create method

    @ApiOperation(value = "删除ensure类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.OTHER, getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/ensureType")
    @CustomResponse
    public RootResponse deleteEnsureTypeV1(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteFaEnsureType(id, userDTO);
    }// end the delete method

    /**
     *
     * ensure
     */
    @ApiOperation("分页查询保障基础信息")
    @GetMapping("/v1/ensure")
    @CustomResponse
    public RootResponse<PageResult<FaEnsureVO>> queryEnsure(@Valid EnsurePageDTO ensureDTO){
        return iEnsureService.queryFaEnsurePage(ensureDTO);
    }// end the query method;

    @ApiOperation("添加保障基础信息")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/ensure")
    @CustomResponse
    public RootResponse createEnsure(@Valid @RequestBody CreateEnsureDTO createEnsureDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createEnsure(createEnsureDTO,userDTO);
    }// end the create method

    @ApiOperation("修改保障基础信息")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/ensure")
    @CustomResponse
    public RootResponse updateEnsure(@Valid @RequestBody UpdateEnsureDTO updateEnsureDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.updateEnsure(updateEnsureDTO,userDTO);
    }// end the update method

    @ApiOperation("删除保障基础信息")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/ensure")
    @CustomResponse
    public RootResponse deleteEnsure(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteEnsure(id,userDTO);
    }

    /**
     * ensurePlan
     */

    @ApiOperation("分页查询保障计划")
    @GetMapping("/v1/ensurePlan")
    @CustomResponse
    public RootResponse<PageResult<FaEnsurePlanVO>> queryEnsurePlan(@Valid EnsurePlanDTO ensurePlanDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        userDTO.setAreaId(loginUser.getArea().get(0).getAreaId());
        return iEnsureService.queryFaEnsurePlanPage(ensurePlanDTO, userDTO);
    }// end the query method;

    @ApiOperation("添加保障计划类型-保养")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/ensurePlan")
    @CustomResponse
    public RootResponse createEnsurePlan(@Valid @RequestBody CreateEnsurePlanDTO createEnsurePlanDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createEnsurePlan(createEnsurePlanDTO,userDTO);
    }// end the create method

//    @ApiOperation("修改保障计划")
////    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
////    @PutMapping("/v1/ensurePlan")
////    public RootResponse updateEnsurePlan(@Valid @RequestBody UpdateEnsurePlanDTO updateEnsurePlanDTO){
////        var loginUser = SecurityUtils.getLoginUser();
////        var userDTO = new LoginUserDTO();
////        userDTO.setUsername(loginUser.getUsername());
////        return iEnsureService.updateEnsurePlan(updateEnsurePlanDTO,userDTO);
////    }// end the update method

    @ApiOperation("停用保障计划")
    @CustomResponse
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/ensurePlan")
    public RootResponse deleteEnsurePlan(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteEnsurePlan(id,userDTO);
    }

    /**
     *
     * ensureRecord
     */
    @ApiOperation("分页查询保障记录")
    @GetMapping("/v1/ensureRecord")
    @CustomResponse
    public RootResponse<PageResult<FaEnsureRecordVO>> queryEnsureRecord(@Valid EnsureRecordPageDTO ensureRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        userDTO.setAreaId(loginUser.getArea().get(0).getAreaId());
        return iEnsureService.queryFaEnsureRecordPage(ensureRecordDTO, userDTO);
    }// end the query method;

    @ApiOperation("添加保障记录类型")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/ensureRecord")
    @CustomResponse
    public RootResponse createEnsureRecord(@Valid @RequestBody CreateEnsureRecordDTO createEnsureRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createEnsureRecord(createEnsureRecordDTO,userDTO);
    }// end the create method

//    @ApiOperation("修改保障记录")
//    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
//    @PutMapping("/v1/ensureRecord")
//    public RootResponse updateEnsureRecord(@Valid @RequestBody UpdateEnsureRecordDTO updateEnsureRecordDTO){
//        var loginUser = SecurityUtils.getLoginUser();
//        var userDTO = new LoginUserDTO();
//        userDTO.setUsername(loginUser.getUsername());
//        return iEnsureService.updateEnsureRecord(updateEnsureRecordDTO,userDTO);
//    }// end the update method

//    @ApiOperation("删除保障记录")
//    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
//    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
//    @DeleteMapping("/v1/ensureRecord")
//    public RootResponse deleteEnsureRecord(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
//        var loginUser = SecurityUtils.getLoginUser();
//        var userDTO = new LoginUserDTO();
//        userDTO.setUsername(loginUser.getUsername());
//        return iEnsureService.deleteEnsureRecord(id,userDTO);
//    }

    /**
     *
     * ensureWays
     */
    @ApiOperation("分页查询保障方法")
    @GetMapping("/v1/ensureWays")
    @CustomResponse
    public RootResponse<PageResult<FaEnsureWaysVO>> queryEnsureWays(@Valid EnsureWaysPageDTO ensureWaysDTO){
        return iEnsureService.queryFaEnsureWaysPage(ensureWaysDTO);
    }// end the query method;

    @ApiOperation("添加保障记录方法")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/ensureWays")
    @CustomResponse
    public RootResponse createEnsureWays(@Valid @RequestBody CreateEnsureWaysDTO createEnsureWaysDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createEnsureWays(createEnsureWaysDTO,userDTO);
    }// end the create method

    @ApiOperation("修改保障方法")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/ensureWays")
    @CustomResponse
    public RootResponse updateEnsureWays(@Valid @RequestBody UpdateEnsureWaysDTO updateEnsureWaysDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.updateEnsureWays(updateEnsureWaysDTO,userDTO);
    }// end the update method

    @ApiOperation("删除保障方法")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/ensureWays")
    @CustomResponse
    public RootResponse deleteEnsureWays(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteEnsureWays(id,userDTO);
    }

    /**
     *
     * fault
     */
    @ApiOperation("分页查询故障现象记录")
    @GetMapping("/v1/phenomenonRecord")
    @CustomResponse
    public RootResponse<PageResult<FaPhenomenonRecordVO>> queryPhenomenonRecord(@Valid FaPhenomenonRecordPageDTO phenomenonRecordDTO){
        return iEnsureService.queryFaPhenomenonRecordPage(phenomenonRecordDTO);
    }// end the query method;

    @ApiOperation("添加故障现象记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/phenomenonRecord")
    @CustomResponse
    public RootResponse createPhenomenonRecord(@Valid @RequestBody CreateFaPhenomenonRecordDTO createPhenomenonRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createFaPhenomenonRecord(createPhenomenonRecordDTO,userDTO);
    }// end the create method

    @ApiOperation("修改故障现象记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/phenomenonRecord")
    @CustomResponse
    public RootResponse updatePhenomenonRecord(@Valid @RequestBody UpdateFaPhenomenonRecordDTO updatePhenomenonRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.updateFaPhenomenonRecord(updatePhenomenonRecordDTO,userDTO);
    }// end the update method

    @ApiOperation("删除故障现象记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/phenomenonRecord")
    @CustomResponse
    public RootResponse deletePhenomenonRecord(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteFaPhenomenonRecord(id,userDTO);
    }

    /**
     *
     * fault phenomenon
     */
    @ApiOperation("分页查询故障现象类型")
    @GetMapping("/v1/phenomenon")
    @CustomResponse
    public RootResponse<PageResult<FaPhenomenonVO>> queryPhenomenon(@Valid FaPhenomenonPageDTO phenomenonDTO){
        return iEnsureService.queryFaPhenomenonPage(phenomenonDTO);
    }// end the query method;

    @ApiOperation("添加故障现象")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/phenomenon")
    @CustomResponse
    public RootResponse createPhenomenon(@Valid @RequestBody CreateFaPhenomenonDTO createPhenomenonDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.createFaPhenomenon(createPhenomenonDTO,userDTO);
    }// end the create method

    @ApiOperation("修改故障现象")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/phenomenon")
    @CustomResponse
    public RootResponse updatePhenomenon(@Valid @RequestBody UpdateFaPhenomenonDTO updatePhenomenonDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.updateFaPhenomenon(updatePhenomenonDTO,userDTO);
    }// end the update method

    @ApiOperation("删除故障现象")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/phenomenon")
    @CustomResponse
    public RootResponse deletePhenomenon(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iEnsureService.deleteFaPhenomenon(id,userDTO);
    }

    /**
     * <p>
     * @ModelName: 维修______模块
     * *************************************
     *      FaRepairMeasures
     *      FaRepairWays
     *      FaRepairEquipment
     *      FaRepairDevice
     *      FaProgrammeMeasures
     *      FaRepairProgramme
     *      FaRepairRecord
     *      FaTechnicalDocumentation
     *      FaFaultRecord ===PHMEnsureRecord
     * *************************************
     * </p>
     */
    /**
     *
     * FaRepairMeasures
     */
    @ApiOperation("分页查询维修措施类型")
    @GetMapping("/v1/repairMeasures")
    @CustomResponse
    public RootResponse<PageResult<FaRepairMeasuresVO>> queryRepairMeasures(@Valid FaRepairMeasuresPageDTO repairMeasuresDTO){
        return iRepairService.queryFaRepairMeasuresPage(repairMeasuresDTO);
    }// end the query method;

    @ApiOperation("添加维修措施")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/repairMeasures")
    @CustomResponse
    public RootResponse createRepairMeasures(@Valid @RequestBody CreateFaRepairMeasuresDTO createRepairMeasuresDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairMeasures(createRepairMeasuresDTO,userDTO);
    }// end the create method

    @ApiOperation("修改维修措施")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/repairMeasures")
    @CustomResponse
    public RootResponse updateRepairMeasures(@Valid @RequestBody UpdateFaRepairMeasuresDTO updateRepairMeasuresDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairMeasures(updateRepairMeasuresDTO,userDTO);
    }// end the update method

    @ApiOperation("删除维修措施")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/repairMeasures")
    @CustomResponse
    public RootResponse deleteRepairMeasures(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairMeasures(id,userDTO);
    }

    /**
     *
     * repairWays
     */
    @ApiOperation("分页查询维修方法")
    @GetMapping("/v1/repairWays")
    @CustomResponse
    public RootResponse<PageResult<FaRepairWaysVO>> queryRepairWays(@Valid FaRepairWaysPageDTO repairWaysDTO){
        return iRepairService.queryFaRepairWaysPage(repairWaysDTO);
    }// end the query method;

    @ApiOperation("添加维修记录方法")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/repairWays")
    @CustomResponse
    public RootResponse createRepairWays(@Valid @RequestBody CreateFaRepairWaysDTO createRepairWaysDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairWays(createRepairWaysDTO,userDTO);
    }// end the create method

    @ApiOperation("修改维修方法")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/repairWays")
    @CustomResponse
    public RootResponse updateRepairWays(@Valid @RequestBody UpdateFaRepairWaysDTO updateRepairWaysDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairWays(updateRepairWaysDTO,userDTO);
    }// end the update method

    @ApiOperation("删除维修方法")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/repairWays")
    @CustomResponse
    public RootResponse deleteRepairWays(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairWays(id,userDTO);
    }

    /**
     *
     *
     * FaRepairEquipment
     */
    @ApiOperation("分页查询维修器材类型")
    @GetMapping("/v1/repairEquipment")
    @CustomResponse
    public RootResponse<PageResult<FaRepairEquipmentVO>> queryRepairEquipment(@Valid FaRepairEquipmentPageDTO repairEquipmentDTO){
        return iRepairService.queryFaRepairEquipmentPage(repairEquipmentDTO);
    }// end the query method;

    @ApiOperation("添加维修器材")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/repairEquipment")
    @CustomResponse
    public RootResponse createRepairEquipment(@Valid @RequestBody CreateFaRepairEquipmentDTO createRepairEquipmentDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairEquipment(createRepairEquipmentDTO,userDTO);
    }// end the create method

    @ApiOperation("修改维修器材")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/repairEquipment")
    @CustomResponse
    public RootResponse updateRepairEquipment(@Valid @RequestBody UpdateFaRepairEquipmentDTO updateRepairEquipmentDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairEquipment(updateRepairEquipmentDTO,userDTO);
    }// end the update method

    @ApiOperation("删除维修器材")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/repairEquipment")
    @CustomResponse
    public RootResponse deleteRepairEquipment(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairEquipment(id,userDTO);
    }

    /**
     *
     *
     * FaRepairDevice
     */
    @ApiOperation("分页查询维修设备类型")
    @GetMapping("/v1/repairDevice")
    @CustomResponse
    public RootResponse<PageResult<FaRepairDeviceVO>> queryRepairDevice(@Valid FaRepairDevicePageDTO repairDeviceDTO){
        return iRepairService.queryFaRepairDevicePage(repairDeviceDTO);
    }// end the query method;

    @ApiOperation("添加维修设备")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/repairDevice")
    @CustomResponse
    public RootResponse createRepairDevice(@Valid @RequestBody CreateFaRepairDeviceDTO createRepairDeviceDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairDevice(createRepairDeviceDTO,userDTO);
    }// end the create method

    @ApiOperation("修改维修设备")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/repairDevice")
    @CustomResponse
    public RootResponse updateRepairDevice(@Valid @RequestBody UpdateFaRepairDeviceDTO updateRepairDeviceDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairDevice(updateRepairDeviceDTO,userDTO);
    }// end the update method

    @ApiOperation("删除维修设备")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/repairDevice")
    @CustomResponse
    public RootResponse deleteRepairDevice(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairDevice(id,userDTO);
    }

    /**
     *
     *
     * FaProgrammeMeasures
     */
//    @ApiOperation("分页查询方案明细类型")
//    @GetMapping("/v1/programmeMeasures")
//    @CustomResponse
//    public RootResponse<PageResult<FaProgrammeMeasuresVO>> queryProgrammeMeasures(@Valid FaProgrammeMeasuresPageDTO programmeMeasuresDTO){
//        return iRepairService.queryFaProgrammeMeasuresPage(programmeMeasuresDTO);
//    }// end the query method;
//
//    @ApiOperation("添加方案明细")
//    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
//    @PostMapping("/v1/programmeMeasures")
//    @CustomResponse
//    public RootResponse createProgrammeMeasures(@Valid @RequestBody CreateFaProgrammeMeasuresDTO createProgrammeMeasuresDTO){
//        var loginUser = SecurityUtils.getLoginUser();
//        var userDTO = new LoginUserDTO();
//        userDTO.setUsername(loginUser.getUsername());
//        return iRepairService.createFaProgrammeMeasures(createProgrammeMeasuresDTO,userDTO);
//    }// end the create method
//
//    @ApiOperation("修改方案明细")
//    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
//    @PutMapping("/v1/programmeMeasures")
//    @CustomResponse
//    public RootResponse updateProgrammeMeasures(@Valid @RequestBody UpdateFaProgrammeMeasuresDTO updateProgrammeMeasuresDTO){
//        var loginUser = SecurityUtils.getLoginUser();
//        var userDTO = new LoginUserDTO();
//        userDTO.setUsername(loginUser.getUsername());
//        return iRepairService.updateFaProgrammeMeasures(updateProgrammeMeasuresDTO,userDTO);
//    }// end the update method
//
//    @ApiOperation("删除方案明细")
//    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
//    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
//    @DeleteMapping("/v1/programmeMeasures")
//    @CustomResponse
//    public RootResponse deleteProgrammeMeasures(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
//        var loginUser = SecurityUtils.getLoginUser();
//        var userDTO = new LoginUserDTO();
//        userDTO.setUsername(loginUser.getUsername());
//        return iRepairService.deleteFaProgrammeMeasures(id,userDTO);
//    }

    /**
     * @description : TODO
     * @param faRepairDeviceMeasuresPageDTO
     * @return : com.szly.phm.common.entity.result.RootResponse<com.szly.phm.common.entity.result.PageResult<com.szly.phm.common.entity.vo.faRepair.FaRepairDeviceMeasuresPageVO>>
     * @author : git.jas0nch
     * date : 2022/2/8
     **/
    @ApiOperation("分页查询设备明细类型")
    @GetMapping("/v1/deviceMeasures")
    @CustomResponse
    public RootResponse<PageResult<FaRepairDeviceMeasuresPageVO>> queryDeviceMeasures(@Valid FaRepairDeviceMeasuresPageDTO faRepairDeviceMeasuresPageDTO){
        return iRepairService.queryFaRepairDeviceMeasuresPage(faRepairDeviceMeasuresPageDTO);
    }// end the query method;

    @ApiOperation("添加设备明细")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/deviceMeasures")
    @CustomResponse
    public RootResponse createDeviceMeasures(@Valid @RequestBody CreateFaRepairDeviceMeasuresDTO createFaRepairDeviceMeasuresDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairDeviceMeasures(createFaRepairDeviceMeasuresDTO,userDTO);
    }// end the create method

    @ApiOperation("修改设备明细")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/deviceMeasures")
    @CustomResponse
    public RootResponse updateDeviceMeasures(@Valid @RequestBody UpdateFaRepairDeviceMeasuresDTO updateRepairDeviceMeasuresDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairDeviceMeasures(updateRepairDeviceMeasuresDTO,userDTO);
    }// end the update method

    @ApiOperation("删除设备明细")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/deviceMeasures")
    @CustomResponse
    public RootResponse deleteDeviceMeasures(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairDeviceMeasures(id,userDTO);
    }

    /**
     * @description : TODO
     * @param faRepairEquipmentMeasuresPageDTO
     * @return : com.szly.phm.common.entity.result.RootResponse<com.szly.phm.common.entity.result.PageResult<com.szly.phm.common.entity.vo.faRepair.FaRepairEquipmentMeasuresVO>>
     * @author : git.jas0nch
     * date : 2022/2/8
     **/
    @ApiOperation("分页查询器材明细类型")
    @GetMapping("/v1/equipmentMeasures")
    @CustomResponse
    public RootResponse<PageResult<FaRepairEquipmentMeasuresVO>> queryEquipmentMeasures(@Valid FaRepairEquipmentMeasuresDTO faRepairEquipmentMeasuresPageDTO){
        return iRepairService.queryFaRepairEquipmentMeasuresPage(faRepairEquipmentMeasuresPageDTO);
    }// end the query method;

    @ApiOperation("添加器材明细")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/equipmentMeasures")
    @CustomResponse
    public RootResponse createEquipmentMeasures(@Valid @RequestBody CreateFaRepairEquipmentMeasuresDTO createFaRepairEquipmentMeasuresDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairEquipmentMeasures(createFaRepairEquipmentMeasuresDTO,userDTO);
    }// end the create method

    @ApiOperation("修改器材明细")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/equipmentMeasures")
    @CustomResponse
    public RootResponse updateEquipmentMeasures(@Valid @RequestBody UpdateFaRepairEquipmentMeasuresDTO updateRepairEquipmentMeasuresDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairEquipmentMeasures(updateRepairEquipmentMeasuresDTO,userDTO);
    }// end the update method

    @ApiOperation("删除器材明细")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/equipmentMeasures")
    @CustomResponse
    public RootResponse deleteEquipmentMeasures(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairEquipmentMeasures(id,userDTO);
    }

    /**
     *
     * FaRepairProgramme
     */
    @ApiOperation("分页查询维修方案类型")
    @GetMapping("/v1/repairProgramme")
    @CustomResponse
    public RootResponse<PageResult<FaRepairProgrammeVO>> queryRepairProgramme(@Valid FaRepairProgrammePageDTO repairProgrammeDTO){
        return iRepairService.queryFaRepairProgrammePage(repairProgrammeDTO);
    }// end the query method;

    @ApiOperation("添加维修方案")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/repairProgramme")
    @CustomResponse
    public RootResponse createRepairProgramme(@Valid @RequestBody CreateFaRepairProgrammeDTO createRepairProgrammeDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairProgramme(createRepairProgrammeDTO,userDTO);
    }// end the create method

    @ApiOperation("修改维修方案")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/repairProgramme")
    @CustomResponse
    public RootResponse updateRepairProgramme(@Valid @RequestBody UpdateFaRepairProgrammeDTO updateRepairProgrammeDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairProgramme(updateRepairProgrammeDTO,userDTO);
    }// end the update method

    @ApiOperation("删除维修方案")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/repairProgramme")
    @CustomResponse
    public RootResponse deleteRepairProgramme(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairProgramme(id,userDTO);
    }

    /**
     *
     * FaRepairRecord
     */
    @ApiOperation("分页查询维修记录类型")
    @GetMapping("/v1/repairRecord")
    @CustomResponse
    public RootResponse<PageResult<FaRepairRecordVO>> queryRepairRecord(@Valid FaRepairRecordPageDTO repairRecordDTO){
        return iRepairService.queryFaRepairRecordPage(repairRecordDTO);
    }// end the query method;

    @ApiOperation("添加维修记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/repairRecord")
    @CustomResponse
    public RootResponse createRepairRecord(@Valid @RequestBody CreateFaRepairRecordDTO createRepairRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaRepairRecord(createRepairRecordDTO,userDTO);
    }// end the create method

    @ApiOperation("修改维修记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/repairRecord")
    @CustomResponse
    public RootResponse updateRepairRecord(@Valid @RequestBody UpdateFaRepairRecordDTO updateRepairRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaRepairRecord(updateRepairRecordDTO,userDTO);
    }// end the update method

    @ApiOperation("删除维修记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/repairRecord")
    @CustomResponse
    public RootResponse deleteRepairRecord(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaRepairRecord(id,userDTO);
    }

    /**
     *
     *
     * FaTechnicalDocumentation
     */
    @ApiOperation("分页查询工卡类型")
    @GetMapping("/v1/technicalDocumentation")
    @CustomResponse
    public RootResponse<PageResult<FaTechnicalDocumentationVO>> queryTechnicalDocumentation(@Valid FaTechnicalDocumentationPageDTO technicalDocumentationDTO){
        return iRepairService.queryFaTechnicalDocumentationPage(technicalDocumentationDTO);
    }// end the query method;

    @ApiOperation("添加工卡")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/technicalDocumentation")
    @CustomResponse
    public RootResponse createTechnicalDocumentation(@Valid @RequestBody CreateFaTechnicalDocumentationDTO createTechnicalDocumentationDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaTechnicalDocumentation(createTechnicalDocumentationDTO,userDTO);
    }// end the create method

    @ApiOperation("修改工卡")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/technicalDocumentation")
    @CustomResponse
    public RootResponse updateTechnicalDocumentation(@Valid @RequestBody UpdateFaTechnicalDocumentationDTO updateTechnicalDocumentationDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaTechnicalDocumentation(updateTechnicalDocumentationDTO,userDTO);
    }// end the update method

    @ApiOperation("删除工卡")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/technicalDocumentation")
    @CustomResponse
    public RootResponse deleteTechnicalDocumentation(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaTechnicalDocumentation(id,userDTO);
    }

    /**
     *
     *
     * FaTechnicalDocumentation
     */
    @ApiOperation("分页查询PHM故障记录类型")
    @GetMapping("/v1/faultRecord")
    @CustomResponse
    public RootResponse<PageResult<FaFaultRecordVO>> queryFaultRecord(@Valid FaFaultRecordPageDTO faFaultRecordPageDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        userDTO.setAreaId(loginUser.getArea().get(0).getAreaId());
        return iRepairService.queryFaFaultRecordPage(faFaultRecordPageDTO, userDTO);
    }// end the query method;

    @ApiOperation("添加PHM故障记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/faultRecord")
    @CustomResponse
    public RootResponse createFaultRecord(@Valid @RequestBody CreateFaFaultRecordDTO createFaultRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();

        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaFaultRecord(createFaultRecordDTO,userDTO);
    }// end the create method

    @ApiOperation("修改PHM故障记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.UPDATE)
    @PutMapping("/v1/faultRecord")
    @CustomResponse
    public RootResponse updateFaultRecord(@Valid @RequestBody UpdateFaFaultRecordDTO updateFaultRecordDTO){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.updateFaFaultRecord(updateFaultRecordDTO,userDTO);
    }// end the update method

    @ApiOperation("删除PHM故障记录")
    @CustomResponse
    @OperationLogAnnotation(getModuleName = ModuleEnum.PERMISSION,getOperationAction = OperationActionEnum.DELETE)
    @ApiImplicitParam(name = "id", value = "参数Id", dataType = "String", required = true, dataTypeClass = String.class)
    @DeleteMapping("/v1/faultRecord")
    public RootResponse deleteFaultRecord(@NotBlank(message = "Id不能为空") @RequestParam(value = "id") String id){
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.deleteFaFaultRecord(id,userDTO);
    }

    @ApiOperation(value = "查询phm记录所对应的现象ids及其对应描述")
    @ApiImplicitParam(name = "faultRecordId", value = "PHM记录Id", dataType = "String", required = true, dataTypeClass = String.class)
    @GetMapping("/v1/faultRecord/phm2Phenomenon")
    @CustomResponse
    public RootResponse<FaultRecordPhenomenonVO> queryFaFaultRecordPhenomenonIdsV1(@NotBlank(message = "所给phm记录id不能为空") String faultRecordId) {
        return iRepairService.queryFaFaultRecordPhenomenonIds(faultRecordId);
    }
    @ApiOperation(value = "phm与故障现象的绑定to现象记录")
    @OperationLogAnnotation(getModuleName = ModuleEnum.OTHER,getOperationAction = OperationActionEnum.SAVE)
    @PostMapping("/v1/faultRecord/phm2Phenomenon")
    @CustomResponse
    public RootResponse createAssignPermissionsV1(@Valid @RequestBody FaultRecordPhenomenonDTO faultRecordPhenomenonDTO) {
        var loginUser = SecurityUtils.getLoginUser();
        var userDTO = new LoginUserDTO();
        userDTO.setUsername(loginUser.getUsername());
        return iRepairService.createFaultPhenomenonRecord(faultRecordPhenomenonDTO,userDTO);
    }
}
